package cn.yy.pojo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Confirm entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "confirm", catalog = "phoneerp")
public class Confirm implements java.io.Serializable {

	// Fields

	private Integer confirmId;
	private Emp emp;
	private Dept dept;
	private Set<Inmatirial> inmatirials = new HashSet<Inmatirial>(0);
	private Set<Outmatirial> outmatirials = new HashSet<Outmatirial>(0);
	private Set<Recipt> recipts = new HashSet<Recipt>(0);
	private Set<Emp> emps = new HashSet<Emp>(0);
	private Set<Paybill> paybills = new HashSet<Paybill>(0);

	// Constructors

	/** default constructor */
	public Confirm() {
	}

	/** minimal constructor */
	public Confirm(Emp emp, Dept dept) {
		this.emp = emp;
		this.dept = dept;
	}

	/** full constructor */
	public Confirm(Emp emp, Dept dept, Set<Inmatirial> inmatirials,
			Set<Outmatirial> outmatirials, Set<Recipt> recipts, Set<Emp> emps,
			Set<Paybill> paybills) {
		this.emp = emp;
		this.dept = dept;
		this.inmatirials = inmatirials;
		this.outmatirials = outmatirials;
		this.recipts = recipts;
		this.emps = emps;
		this.paybills = paybills;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "confirmId", unique = true, nullable = false)
	public Integer getConfirmId() {
		return this.confirmId;
	}

	public void setConfirmId(Integer confirmId) {
		this.confirmId = confirmId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "empId", nullable = false)
	public Emp getEmp() {
		return this.emp;
	}

	public void setEmp(Emp emp) {
		this.emp = emp;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "deptId", nullable = false)
	public Dept getDept() {
		return this.dept;
	}

	public void setDept(Dept dept) {
		this.dept = dept;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "confirm")
	public Set<Inmatirial> getInmatirials() {
		return this.inmatirials;
	}

	public void setInmatirials(Set<Inmatirial> inmatirials) {
		this.inmatirials = inmatirials;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "confirm")
	public Set<Outmatirial> getOutmatirials() {
		return this.outmatirials;
	}

	public void setOutmatirials(Set<Outmatirial> outmatirials) {
		this.outmatirials = outmatirials;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "confirm")
	public Set<Recipt> getRecipts() {
		return this.recipts;
	}

	public void setRecipts(Set<Recipt> recipts) {
		this.recipts = recipts;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "confirm")
	public Set<Emp> getEmps() {
		return this.emps;
	}

	public void setEmps(Set<Emp> emps) {
		this.emps = emps;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "confirm")
	public Set<Paybill> getPaybills() {
		return this.paybills;
	}

	public void setPaybills(Set<Paybill> paybills) {
		this.paybills = paybills;
	}

}